package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.Project;

import java.util.List;

public interface ProjectMapper extends BaseMapper<Project> {
    @Select("SELECT * FROM project WHERE username=#{username}")
    List<Project> selectproject(String username);

    @Select("SELECT * FROM project WHERE supervisor=#{username}")
    List<Project> selectProject(String username);
@Update("UPDATE project SET `review`='已评审' WHERE project_name=#{projectName}")
    void updatreview(@Param("projectName") String projectName);
    @Update("UPDATE project SET state= #{state} WHERE project_name=#{projectName}")
    void updatstate(@Param("projectName") String projectName, @Param("state") String state);
    @Select("SELECT * FROM project WHERE project_name=#{projectName}")
    Project selectprijectname(@Param("projectName") String projectName);
}
